package fr.alesia.capital;

import java.util.Collections;
import java.util.List;
import java.util.logging.Logger;

import fr.alesia.capital.bean.Pays;
import fr.alesia.capital.bean.comparator.ContinentComparator;
import fr.alesia.capital.dao.PaysDao;
import fr.alesia.capital.factory.DaoFactory;

public class Test {

	public static void main(String[] args) {
		
		PaysDao dao = DaoFactory.getPaysDao();
		Pays pays = dao.get("Mongolie");
		Logger.getAnonymousLogger().info("Pays pays = dao.get(\"Mongolie\");");
		Logger.getAnonymousLogger().info(pays.toString());
		
		Logger.getAnonymousLogger().info("SortedSet<Pays> elements = dao.getAll();");
		List<Pays> elements = dao.getAll();
		for (Pays element : elements) {
			Logger.getAnonymousLogger().info(element.toString());
		}
		Collections.sort(elements, ContinentComparator.getComparator());
		for (Pays element : elements) {
			Logger.getAnonymousLogger().info(element.toString());
		}
	}
}
